<!doctype html>
<head>
<script src="js/jquery.js"></script>
<script src="js/jquery.form.js"></script>
<style>
form { display: block; margin: 20px auto; background: #eee; border-radius: 10px; padding: 15px }
#progress { position:relative; width:400px; border: 1px solid #ddd; padding: 1px; border-radius: 3px; }
#bar { background-color: #B4F5B4; width:0%; height:20px; border-radius: 3px; }
#percent { position:absolute; display:inline-block; top:3px; left:48%; }
</style>
</head>
<body>
<h1>Netshadow Public File Sender</h1>
<?php
	require_once("config.php");
echo "The maximum file size is " . $max . ".<br>";
?>
<a href="https://code.google.com/p/complete-file-sender/source/browse/">File Sender Source Code</a><br>
This program is released under the <a href="LICENSE.txt" target="_blank">MIT License</a><br>
<form id="myForm" action="upload.php" method="post" enctype="multipart/form-data">
	 Your e-mail address: <input type="text" name="sender" required><br>
	 Recipient e-mail address: <input type="text" name="recipient" required><br>
	 Receive copy of e-mail sent to recipient:
	 <input type="radio" name="ccme" value="yes">yes 
	 <input type="radio" name="ccme" value="no" checked="checked">no<br>
     <input type="file" size="60" name="myfile"><br>
     <input type="submit" value="Upload and Send File">
 </form>
 
 
 <div id="progress">
        <div id="bar"></div>
        <div id="percent">0%</div >
</div>
<br>
    
<div id="message"></div>


<script>
$(document).ready(function()
{

	var options = { 
    beforeSend: function() 
    {
    	$("#progress").show();
    	//clear everything
    	$("#bar").width('0%');
    	$("#message").html("");
		$("#percent").html("0%");
    },
    uploadProgress: function(event, position, total, percentComplete) 
    {
    	$("#bar").width(percentComplete+'%');
    	$("#percent").html(percentComplete+'%');

    
    },
    success: function() 
    {
        $("#bar").width('100%');
    	$("#percent").html('100%');

    },
	complete: function(response) 
	{
		$("#message").html("<font color='green'>"+response.responseText+"</font>");
	},
	error: function()
	{
		$("#message").html("<font color='red'> ERROR: unable to upload files</font>");

	}
     
}; 

     $("#myForm").ajaxForm(options);

});

</script>
</body>


</html>
